const fs = require("fs");
const path = require("path");
const basePath = "/home/b8313/stable-diffusion-webui/outputs/txt2img-images/";
try {
  const files = fs.readdirSync(basePath);
  files.forEach((file) => {
    console.log(file);
    const totalPath = path.join(basePath, file);
    fs.unlinkSync(totalPath);
  });
} catch (e) {
  console.log(e);
}